package com.zhousb.file_retrieval_server.controller;

import com.zhousb.file_retrieval_server.common.R;
import com.zhousb.file_retrieval_server.common.ResponseResult;
import com.zhousb.file_retrieval_server.domain.dto.LoginDto;
import com.zhousb.file_retrieval_server.domain.vo.AuthVo;
import com.zhousb.file_retrieval_server.service.LoginService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/auth")
@Tag(name = "用户认证")
public class AuthController {

    @Resource
    LoginService loginService;

    @PostMapping("/login")
    public ResponseResult<AuthVo> login(@RequestBody LoginDto dto) {
        return R.success(loginService.login(dto));
    }

    @GetMapping("/logout")
    public ResponseResult logout() {
        return R.success();
    }
}
